<html>
<head><meta charset="utf-8"><title>treat-err-as-bug/delay_span_bug panics · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html">treat-err-as-bug/delay_span_bug panics</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226499791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226499791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BN <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226499791">(Feb 16 2021 at 11:04)</a>:</h4>
<p>I get the following panic when trying to run <code>ui/treat-err-as-bug/delay_span_bug</code> on the latest nightly:</p>
<div class="codehilite"><pre><span></span><code>error: internal compiler error: delayed span bug triggered by #[rustc_error(delay_span_bug_from_inside_query)]
  --&gt; src/test/ui/treat-err-as-bug/delay_span_bug.rs:11:1
   |
11 | fn main() {}
   | ^^^^^^^^^
   |
   = note: delayed at compiler/rustc_middle/src/util/bug.rs:45:14

thread &#39;rustc&#39; panicked at &#39;no errors encountered even though `delay_span_bug` issued&#39;, compiler/rustc_errors/src/lib.rs:1011:13
</code></pre></div>
<p>This causes the test to fail. How can this be? Does anybody else have this problem?</p>



<a name="226500901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226500901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BN <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226500901">(Feb 16 2021 at 11:16)</a>:</h4>
<p>nvm, I think this has something to do with my local llvm version.</p>



<a name="226514349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226514349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BN <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226514349">(Feb 16 2021 at 13:46)</a>:</h4>
<p>I doesn't have anything to do with my llvm version. Even after rebuilding the llvm version supplied with rustc I still get the panic. Does anybody have a clue what might cause this?</p>



<a name="226515232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226515232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BN <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226515232">(Feb 16 2021 at 13:56)</a>:</h4>
<p>This also panics in the <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=84eeacbde2955e233af0d2c5de41fcf9">playground</a>. The test fails if this panics, how can this be in the nightly version if the test doesn't pass?</p>



<a name="226516863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226516863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226516863">(Feb 16 2021 at 14:10)</a>:</h4>
<p>I'm not familiar with that test at all -- but isn't the compiler supposed to panic in that test?</p>
<div class="codehilite"><pre><span></span><code>// compile-flags: -Ztreat-err-as-bug
// failure-status: 101
// error-pattern: aborting due to `-Z treat-err-as-bug=1`
// error-pattern: [trigger_delay_span_bug] trigger a delay span bug
// normalize-stderr-test &quot;note: .*\n\n&quot; -&gt; &quot;&quot;
// normalize-stderr-test &quot;thread &#39;rustc&#39; panicked.*\n&quot; -&gt; &quot;&quot;
</code></pre></div>
<p>I guess it is supposed to panic with this output (different from the output you provided):</p>
<div class="codehilite"><pre><span></span><code>error: internal compiler error: delayed span bug triggered by #[rustc_error(delay_span_bug_from_inside_query)]
  --&gt; &lt;anon&gt;:11:1
   |
11 | fn main() {}
   | ^^^^^^^^^

thread &#39;rustc&#39; panicked at &#39;aborting due to `-Z treat-err-as-bug=1`&#39;, compiler/rustc_errors/src/lib.rs:990:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&amp;template=ice.md

note: rustc 1.51.0-nightly (a2f8f6281 2021-01-27) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z treat-err-as-bug

query stack during panic:
#0 [trigger_delay_span_bug] trigger a delay span bug
end of query stack
</code></pre></div>



<a name="226517489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226517489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BN <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226517489">(Feb 16 2021 at 14:15)</a>:</h4>
<p>Could be, but I don't understand why the test fails then:</p>
<div class="codehilite"><pre><span></span><code>failures:

---- [ui] ui/treat-err-as-bug/delay_span_bug.rs stdout ----
diff of stderr:

4   LL | fn main() {}
5      | ^^^^^^^^^
6
+   stack backtrace:
+      0: std::panicking::begin_panic
+      1: rustc_errors::HandlerInner::emit_diagnostic
+      2: rustc_errors::HandlerInner::emit_diag_at_span
+      3: rustc_errors::HandlerInner::span_bug
+      4: rustc_errors::Handler::delay_span_bug
+      5: rustc_middle::util::bug::trigger_delay_span_bug
+      6: rustc_middle::ty::query::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_middle::ty::context::TyCtxt&gt; for rustc_middle::ty::query::queries::trigger_delay_span_bug&gt;::compute
+      7: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_task_impl
+      8: rustc_data_structures::stack::ensure_sufficient_stack
+      9: rustc_query_system::query::plumbing::force_query_with_job
+     10: rustc_query_system::query::plumbing::get_query_impl
+     11: rustc_query_system::query::plumbing::get_query
+     12: rustc_interface::queries::Queries::check_for_rustc_errors_attr
+     13: rustc_interface::passes::QueryContext::enter
+     14: rustc_interface::queries::Query&lt;T&gt;::compute
+     15: rustc_interface::queries::Queries::ongoing_codegen
+     16: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::enter
+     17: rustc_span::with_source_map
+     18: rustc_interface::interface::create_compiler_and_run
+     19: scoped_tls::ScopedKey&lt;T&gt;::set
+     20: rustc_span::with_session_globals
7   error: internal compiler error: unexpected panic
</code></pre></div>



<a name="226517613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226517613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226517613">(Feb 16 2021 at 14:16)</a>:</h4>
<p>You have RUST_BACKTRACE=1 set, which changes the output.</p>



<a name="226517982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226517982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BN <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226517982">(Feb 16 2021 at 14:19)</a>:</h4>
<p>oh yes^^. sorry</p>



<a name="226518043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226518043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BN <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226518043">(Feb 16 2021 at 14:20)</a>:</h4>
<p>thanks for the help</p>



<a name="226518199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226518199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BN <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226518199">(Feb 16 2021 at 14:21)</a>:</h4>
<p>wouldn't it make set to unset this automatically before the tests are run?</p>



<a name="226519121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226519121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226519121">(Feb 16 2021 at 14:29)</a>:</h4>
<p>I use it a lot for new tests actually, it lets me find bugs in a new feature</p>



<a name="226519152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/treat-err-as-bug/delay_span_bug%20panics/near/226519152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/treat-err-as-bug.2Fdelay_span_bug.20panics.html#226519152">(Feb 16 2021 at 14:29)</a>:</h4>
<p>It probably makes sense to unset the variable for this specific test though</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>